﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyBlog.ServiceInterface;
using MyBlog.Model;
using MyBlog.Common;
using MyBlog.BusinessInterface;

namespace MyBlog.Service
{
    public class AccountService : IAccountService
    {
        IBusinessAccount _business;

        public AccountService(IBusinessAccount business)
        {
            _business = business;
        }

        public void Add(AccountModel model)
        {
            _business.Add(model);
        }

        public void AddRange(IEnumerable<AccountModel> models)
        {
            _business.AddRange(models);
        }

        public void Update(AccountModel model)
        {
            _business.Update(model);
        }

        public void DeleteRange(IEnumerable<AccountModel> models)
        {
            _business.DeleteRange(models);
        }

        public List<AccountModel> GetAll(bool isTracking = true)
        {
            return _business.GetAll(isTracking);
        }

        public void Delete(params object[] primaryKey)
        {
            _business.Delete(primaryKey);
        }

        public void Delete(AccountModel model)
        {
            _business.Delete(model);
        }

        public AccountModel Get(params object[] primaryKey)
        {
            return _business.Get(primaryKey);
        }

        public AccountModel Get(AccountModel model)
        {
            return _business.Get(model);
        }

        public List<AccountModel> GetAll(AccountModel model, bool isTracking = true)
        {
            return _business.GetAll(model, isTracking);
        }

        public List<AccountModel> GetAll(AccountModel model, int page, int size, out int total, bool isTracking = true)
        {
            throw new NotImplementedException();
        }

        public void UploadUserHead(string account, HeaderModel head)
        {
            _business.UploadUserHead(account, head);
        }

        public void SaveUserWantSay(string account, string wantsay)
        {
            _business.SaveUserWantSay(account, wantsay);
        }

        public void UpdatePassword(AccountModel model)
        {
            _business.UpdatePassword(model);
        }

        public void Active(string account)
        {
            _business.Active(account);
        }
    }
}
